﻿using Mobile.Controllers;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting.Web;
using System.Web.Mvc;

namespace Mobile.Tests
{
    
    
    /// <summary>
    ///This is a test class for PartySelectControllerTest and is intended
    ///to contain all PartySelectControllerTest Unit Tests
    ///</summary>
    [TestClass()]
    public class PartySelectControllerTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for PartySelectController Constructor
        ///</summary>
        [TestMethod()]
        //[HostType("ASP.NET")]
        //[AspNetDevelopmentServerHost("C:\\Users\\Jim\\Documents\\Senior Year\\CS 638\\CurrentSolution\\TFS_Solution\\Mobile\\Mobile", "/")]
        [UrlToTest("http://localhost:1034/")]
        public void PartySelectControllerConstructorTest()
        {
            PartySelectController target = new PartySelectController();
            Assert.IsNotNull(target);
        }

        /// <summary>
        ///A test for AvailableParties
        ///</summary>
        [TestMethod()]
        //[HostType("ASP.NET")]
        //[AspNetDevelopmentServerHost("C:\\Users\\Jim\\Documents\\Senior Year\\CS 638\\CurrentSolution\\TFS_Solution\\Mobile\\Mobile", "/")]
        [UrlToTest("http://localhost:1034/")]
        public void AvailablePartiesTest()
        {
            PartySelectController target = new PartySelectController(); // initialize our partyselectcontroller
            FormCollection collection = new FormCollection(); // Initialize a formCollection

            ActionResult expected = new System.Web.Mvc.ViewResult(); // Expected result type is a view
            ActionResult actual;
            actual = target.AvailableParties(collection);  //currently don't need to test with valid collection as we are implementing it elsewhere
            
            //we will verify we are passing correct type
            Type expectedType = expected.GetType();
            Type actualType = actual.GetType();
            //assert they are equal
            Assert.AreEqual(expectedType, actualType);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }



        /// <summary>
        ///A test for Index
        ///</summary>
        [TestMethod()]
        //[HostType("ASP.NET")]
        //[AspNetDevelopmentServerHost("C:\\Users\\Jim\\Documents\\Senior Year\\CS 638\\CurrentSolution\\TFS_Solution\\Mobile\\Mobile", "/")]
        [UrlToTest("http://localhost:1034/")]
        public void IndexTest()
        {
            PartySelectController target = new PartySelectController(); // Initialize generic controller
            ActionResult expected = new System.Web.Mvc.ViewResult(); // Initialize 'expected' to type we are expecting
            ActionResult actual;
            actual = target.Index();
            //we want to make sure we are correctly returning of type 'View'
            Type expectedType = expected.GetType();
            Type actualType = actual.GetType();
            Assert.AreEqual(expectedType, actualType);

            //Let's also assert we don't return a null view
            Assert.IsNotNull(actual);
        }
    }
}
